#!/bin/sh

set -e

version=$(`dirname $0`/osv-version.sh)

make -j8 clean
make -j8 external
make -j8 all

image=build/release/usr.img

url=s3://downloads.osv.io/qemu/osv-$version.qcow2

s3cmd put $image $url

s3cmd setacl $url --acl-public

echo "OSv $version is now available for download at:"
echo ""
echo "http://downloads.osv.io.s3-website-us-east-1.amazonaws.com/qemu/osv-$version.qcow2"
